import type { TableList } from './type'
import { PAGING } from '@/constant'
import type {
  MeasuringToolsQueryParams,
  MeasuringToolsSaveOrUpdateParams,
} from '@/types'
import { CONTAIN_SUB } from '@/enum/modules/public'

export const defaultFormData: Partial<MeasuringToolsSaveOrUpdateParams>
  = {
    accessStatus: undefined as any,
    accessSystem: '',
    accuracyLevel: '',
    annexName: '',
    annexUrl: '',
    clearTime: '',
    code: '',
    energyCode: '',
    energyId: undefined as any,
    energyName: '',
    factory: '',
    indicatorSum: 0,
    installationLocation: '',
    installationManufacturer: '',
    installationTime: '',
    measurementLevel: '',
    measuringRange: '',
    name: '',
    nextVerificationDate: '',
    notVerificationReason: '',
    parentId: null as any,
    pointId: 0,
    replacementTime: '',
    specification: '',
    statusTime: '',
    tenantId: 0,
    type: '',
    verificationCycle: undefined,
    verificationDate: '',
    verificationMechanism: '',
    verificationResult: '',
    workingStatus: '',
  }
export const testData: TableList = {
  id: 1,
  parentId: undefined as any,
  name: '计量器具名称示例',
  installationLocation: '仪表安装位置示例',
  installationTime: '2023-06-7',
  specification: '规格型号示例',
  factory: '生产厂家示例',
  verificationDate: '2023-08-9',
  effectiveTime: '2023-0.jpg',
  expireTime: '2024-01-1',
  accuracyLevel: '一级',
  measuringRange: '测量范围示例',
  measurementLevel: 1,
  type: 2,
  energyVarieties: 3,
  clearTime: '2023-06-08',
  replacementTime: '2024-06-08',
  workingStatus: '',
  accessStatus: '',
  verificationResult: '',
  code: '',
}

export const formRules = generateCurrencyFormRules([
  'name',
  'type',
  'workingStatus',
  'accessStatus',
  'measurementLevel',
  'verificationResult',
  'code',
  'energyId',
])

export const defaultPagingParams: Partial<MeasuringToolsQueryParams>
  = {
    ...PAGING.PARAMS,
    containSub: CONTAIN_SUB.NO_SUB,
    energyId: undefined as any,
    pointId: 0,
  }
